﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style>/*<![CDATA[*/

table{border: 1px solid gray;}
td{border: 1px dotted gray;}
p{margin: 3px 0 3px 0; padding: 0;}
#ID_Footer{font-size: small; font-style: italic; text-align: right; margin-top: 4em; padding-top: 4px; border-top: 2px solid gray;}

/*]]>*/</style><title>code snippets</title></head><body>
<div><br></div>
<div><span style="font-family: 微软雅黑; font-size: 12pt; font-weight: bold; line-height: 190%">创建Date对象，得到小时数</span></div><div><span style="font-family: 微软雅黑; font-size: 12pt; font-weight: bold; line-height: 190%"><br></span></div>
<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><font class="Apple-style-span" face="微软雅黑" size="2"><span class="Apple-style-span" style="line-height: 18px;"><table style="color: rgb(51, 51, 51); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: medium; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><tbody><tr><td><pre style="margin: 0px; line-height: 16.25px;">1
2</pre></td><td><pre style="margin: 0px; line-height: 16.25px;">       <span style="color: rgb(0, 0, 255);">var</span> today = <span style="color: rgb(0, 0, 255);">new</span> Date();                <span style="color: rgb(0, 128, 0);">//创建一个Date对象</span>
       <span style="color: rgb(0, 0, 255);">var</span> hourNow = today.<font class="Apple-style-span" color="#ff00ff">getHours</font>();        <span style="color: rgb(0, 128, 0);">//得到当前的时间</span>
</pre></td></tr></tbody></table></span></font></div></blockquote>
<div><br></div><div><br></div><div><br></div><script type="text/javascript" language="javascript" src="jquery.js"></script><script type="text/javascript" language="javascript" src="itemlink.js"></script></body></html>